<?php
namespace app\common\model;

use think\Model;
/**
 * 类别model
 */
class Cat extends Model
{
    /**
     * @param $data
     * @return false|int
     * 添加分类
     */
    public function add($data) {
        return $this->save($data);
    }
    /**
     * 获得父id大于0的类别数据
     * @return [type] [description]
     */
    public function getCat(){
        return $this->where('parent_id','>',0)->order('create_time')->select();
    }
}